home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / R.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  4KB  |  128 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Vaidotas Zemlys <mpiktas@gmail.com>
  5.  Copyright (C) 2005 Vaidotas Zemlys <mpiktas@gmail.com>
  6.  
  7.  This library is free software; you can redistribute it and/or modify
  8.  it under the terms of the GNU General Public License as published by
  9.  the Free Software Foundation; either version 2 of the License, or
  10.  (at your option) any later version.
  11.  
  12.  This program is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  GNU General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU General Public License
  18.  along with this program; if not, write to the Free Software
  19.  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20.  
  21. -->
  22. <language id="r" _name="R" version="2.0" _section="Scripts">
  23.   <metadata>
  24.     <property name="mimetypes">text/x-R</property>
  25.     <property name="globs">*.R,*.Rout;*.r;*.Rhistory;*.Rt;*.Rout.save;*.Rout.fail</property>
  26.     <property name="line-comment-start">#</property>
  27.   </metadata>
  28.  
  29.   <styles>
  30.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  31.     <style id="reserved-classes" _name="Reserved Class" map-to="def:type"/>
  32.     <style id="assignment-operator" _name="Assignment Operator" map-to="def:operator"/>
  33.     <style id="delimiter" _name="Delimiter" map-to="def:operator"/>
  34.     <style id="special-constant" _name="Special Constant" map-to="def:special-constant"/>
  35.     <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
  36.     <style id="integer-number" _name="Integer Number" map-to="def:base-n-integer"/>
  37.     <style id="floating-point" _name="Floating point number" map-to="def:floating-point"/>
  38.   </styles>
  39.  
  40.   <definitions>
  41.  
  42.     <context id="keywords" style-ref="keyword">
  43.       <keyword>break</keyword>
  44.       <keyword>else</keyword>
  45.       <keyword>for</keyword>
  46.       <keyword>if</keyword>
  47.       <keyword>in</keyword>
  48.       <keyword>next</keyword>
  49.       <keyword>repeat</keyword>
  50.       <keyword>return</keyword>
  51.       <keyword>switch</keyword>
  52.       <keyword>try</keyword>
  53.       <keyword>while</keyword>
  54.     </context>
  55.  
  56.     <context id="reserved-classes" style-ref="reserved-classes">
  57.       <keyword>array</keyword>
  58.       <keyword>character</keyword>
  59.       <keyword>complex</keyword>
  60.       <keyword>data.frame</keyword>
  61.       <keyword>double</keyword>
  62.       <keyword>factor</keyword>
  63.       <keyword>function</keyword>
  64.       <keyword>integer</keyword>
  65.       <keyword>list</keyword>
  66.       <keyword>logical</keyword>
  67.       <keyword>matrix</keyword>
  68.       <keyword>numeric</keyword>
  69.       <keyword>vector</keyword>
  70.     </context>
  71.  
  72.     <context id="assignment-operator" style-ref="assignment-operator">
  73.       <match>(<){1,2}-</match>
  74.     </context>
  75.  
  76.     <context id="delimiters" style-ref="delimiter">
  77.       <match>[\)\(]+|[\{\}]+|[][]+</match>
  78.     </context>
  79.  
  80.     <context id="special-constants" style-ref="special-constant">
  81.       <keyword>Inf</keyword>
  82.       <keyword>NA</keyword>
  83.       <keyword>NaN</keyword>
  84.       <keyword>NULL</keyword>
  85.     </context>
  86.  
  87.     <context id="boolean" style-ref="boolean">
  88.       <keyword>FALSE</keyword>
  89.       <keyword>TRUE</keyword>
  90.     </context>
  91.  
  92.     <context id="integer-number" style-ref="integer-number">
  93.       <match extended="true">
  94.         (?<![\w\.])
  95.         ([1-9][0-9]*|0)[i]?
  96.         (?![\w\.])
  97.       </match>
  98.     </context>
  99.  
  100.     <context id="floating-point" style-ref="floating-point">
  101.       <match extended="true">
  102.         (?<![\w\.])
  103.         ([0-9]+[Ee][-+]?[0-9]+|
  104.          ([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-+]?[0-9]+)?)
  105.         [i]?
  106.         (?![\w\.])
  107.       </match>
  108.     </context>
  109.  
  110.     <context id="r">
  111.       <include>
  112.         <context ref="def:shell-like-comment"/>
  113.         <context ref="def:string"/>
  114.         <context ref="def:single-quoted-string"/>
  115.         <context ref="keywords"/>
  116.         <context ref="assignment-operator"/>
  117.         <context ref="delimiters"/>
  118.         <context ref="special-constants"/>
  119.         <context ref="boolean"/>
  120.         <context ref="integer-number"/>
  121.         <context ref="floating-point"/>
  122.       </include>
  123.     </context>
  124.  
  125.   </definitions>
  126.  
  127. </language>
  128.